package com.ruoyi.evalution.service.impl;

import java.math.BigDecimal;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.evalution.mapper.LabEvalutionResultMapper;
import com.ruoyi.evalution.domain.LabEvalutionResult;
import com.ruoyi.evalution.service.ILabEvalutionResultService;

/**
 * 评测分数Service业务层处理
 * 
 * @author winner pan
 * @date 2022-04-15
 */
@Service
public class LabEvalutionResultServiceImpl implements ILabEvalutionResultService {
	@Autowired
	private LabEvalutionResultMapper labEvalutionResultMapper;

	/**
	 * 查询评测分数
	 * 
	 * @param evalutionResultId
	 *            评测分数ID
	 * @return 评测分数
	 */
	@Override
	public LabEvalutionResult selectLabEvalutionResultById(Long evalutionResultId) {
		return labEvalutionResultMapper.selectLabEvalutionResultById(evalutionResultId);
	}

	/**
	 * 查询评测分数列表
	 * 
	 * @param labEvalutionResult
	 *            评测分数
	 * @return 评测分数
	 */
	@Override
	public List<LabEvalutionResult> selectLabEvalutionResultList(LabEvalutionResult labEvalutionResult) {
		return labEvalutionResultMapper.selectLabEvalutionResultList(labEvalutionResult);
	}

	/**
	 * 新增评测分数
	 * 
	 * @param labEvalutionResult
	 *            评测分数
	 * @return 结果
	 */
	@Override
	public int insertLabEvalutionResult(LabEvalutionResult labEvalutionResult) {
		return labEvalutionResultMapper.insertLabEvalutionResult(labEvalutionResult);
	}

	/**
	 * 修改评测分数
	 * 
	 * @param labEvalutionResult
	 *            评测分数
	 * @return 结果
	 */
	@Override
	public int updateLabEvalutionResult(LabEvalutionResult labEvalutionResult) {
		return labEvalutionResultMapper.updateLabEvalutionResult(labEvalutionResult);
	}

	/**
	 * 批量删除评测分数
	 * 
	 * @param evalutionResultIds
	 *            需要删除的评测分数ID
	 * @return 结果
	 */
	@Override
	public int deleteLabEvalutionResultByIds(Long[] evalutionResultIds) {
		return labEvalutionResultMapper.deleteLabEvalutionResultByIds(evalutionResultIds);
	}

	/**
	 * 删除评测分数信息
	 * 
	 * @param evalutionResultId
	 *            评测分数ID
	 * @return 结果
	 */
	@Override
	public int deleteLabEvalutionResultById(Long evalutionResultId) {
		return labEvalutionResultMapper.deleteLabEvalutionResultById(evalutionResultId);
	}
	
	 public BigDecimal getParticipatorAvgScore(LabEvalutionResult labEvalutionResult){
		return  labEvalutionResultMapper.getParticipatorAvgScore(labEvalutionResult);
	 }
}
